From: Tim Deegan Date: Thu, 5 Apr 2007 17:12:21 +0000 (+0100) Subject: [HVM] Save/restore: qemu-dm should calculate bitmap size from maximum gpfn X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15264^2~5 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=fdcf726e9d8128f90cf180116fd9cb084548abea;p=xen.git [HVM] Save/restore: qemu-dm should calculate bitmap size from maximum gpfn like xc_save does. Signed-off-by: Tim Deegan --- diff --git a/tools/ioemu/xenstore.c b/tools/ioemu/xenstore.c index e04a74236c..35484bbc90 100644 --- a/tools/ioemu/xenstore.c +++ b/tools/ioemu/xenstore.c @@ -248,12 +248,8 @@ void xenstore_process_logdirty_event(void) key = (key_t) strtoull(key_terminated, NULL, 16); /* Figure out how bit the log-dirty bitmaps are */ - logdirty_bitmap_size = ((phys_ram_size + 0x20 - - (vga_ram_size + bios_size)) - >> (TARGET_PAGE_BITS)); /* nr of bits in map*/ - if (logdirty_bitmap_size > HVM_BELOW_4G_MMIO_START >> TARGET_PAGE_BITS) - logdirty_bitmap_size += - HVM_BELOW_4G_MMIO_LENGTH >> TARGET_PAGE_BITS; /* still bits */ + logdirty_bitmap_size = xc_memory_op(xc_handle, + XENMEM_maximum_gpfn, &domid) + 1; logdirty_bitmap_size = ((logdirty_bitmap_size + HOST_LONG_BITS - 1) / HOST_LONG_BITS); /* longs */ logdirty_bitmap_size *= sizeof (unsigned long); /* bytes */